<template>
	<nav class="navbar-default navbar-static-side own-nav fixedleft" >
		<div class="sidebar-collapse">
			<ul class="nav" id="side-menu">
				<user></user>
				<li><a @click='go("/main/hello")'><i class="fa fa-home"></i><span class="nav-label">主页</span></a></li>
				<li><a @click='go("/main/userHome")'><i class="fa fa-home"></i><span class="nav-label">导航</span></a></li>
				<li v-for='el in data'><a ><i class="fa fa-home"></i><span class="nav-label">vuex动态改变：{{el.name}}</span></a></li>
				<li><a><i class="fa fa-home"></i>{{countValue}}</a></li>
			</ul>
		</div>
	</nav>
</template>
<script>
	import User from './User'
	import store from '../vuex/store'
	export default {
		components: {
			User
		},
		data(){
			return{
				datas:[]
			}
		},
		methods:{
			go(el){
				this.$route.router.go({
					path: el
				})
			},
			
		},
		store:store,
		vuex: {
		    getters: {
		      data: state => state.list,  //获取我们刚刚在store文件中定义的list数组对象
		      countValue:state => state.count //获取count变量，用于显示加减改变的值
		    }
		},
	}
</script>
<style scoped>
	
</style>